<template>
  <div class="container">
    <div class="box" @mouseenter="showOtherBox" @mouseleave="hideOtherBox">
      鼠标移入移出
    </div>
    <div class="other-box" v-show="isOtherBoxVisible">
      控制元素的显示隐藏
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isOtherBoxVisible: false
    };
  },
  methods: {
    showOtherBox() {
      this.isOtherBoxVisible = true;
    },
    hideOtherBox() {
      this.isOtherBoxVisible = false;
    }
  }
};
</script>

<style>
.container {
  position: relative;
  width: 300px;
  height: 200px;
  border: 1px solid #000;
}

.box {
  width: 100%;
  height: 50%;
  background-color: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.other-box {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 50%;
  background-color: #e0e0e0;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>